Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Group State Flags

Every display group has group state value (built out of a set of group state flags ) that determine how the group is traversed during rendering or picking, or during the computation of a bounding box or sphere. Here are the currently defined group state flags:

typedef enum TQ3DisplayGroupStateMasks {
    kQ3DisplayGroupStateNone                                = 0,
    kQ3DisplayGroupStateMaskIsDrawn                         = 1 << 0,
    kQ3DisplayGroupStateMaskIsInline                        = 1 << 1,
    kQ3DisplayGroupStateMaskUseBoundingBox                  = 1 << 2,
    kQ3DisplayGroupStateMaskUseBoundingSphere               = 1 << 3,
    kQ3DisplayGroupStateMaskIsPicked                        = 1 << 4,
    kQ3DisplayGroupStateMaskIsWritten                       = 1 << 5
} TQ3DisplayGroupStateMasks;
typedef unsigned long       TQ3DisplayGroupState;

A group state value contains a flag, called the drawable flag, that determines whether the group is to be drawn when it is passed to a view for rendering or picking. By default, the drawable flag of a group state value is set, indicating that the group is to be drawn to a view. If the drawable flag is clear, the group is not traversed when it is encountered in a hierarchical model. This allows you to place "invisible" objects in a model that assist you in bounding complex geometric objects, for example.

An ordered display group can be constructed in such a way that the group has a hierarchical structure. This allows properties (such as attributes, styles, and transforms) to be inherited by child nodes from their parent nodes in the hierarchy. Occasionally, however, you might want to override this inheritance and allow a group contained in a hierarchical model to define its own graphics state independently of any other objects or groups in the model. To allow this feature, a group state value contains an inline flag that specifies whether or not the group should be executed inline. A group is executed inline if it does not push and pop the graphics state stack before and after it is executed (that is, if it is simply executed as a bundle of objects). By default, the inline flag of a group is not set, indicating that the group pushes and pops its graphics state.

For more information on pushing and popping the graphics state, see the descriptions of the functions Q3Push_Submit and Q3Pop_Submit in the chapter "View Objects."

A group state value contains a picking flag that determines whether the group can be picked. In general, you'll want all groups in a model to be eligible for picking. In some cases, however, you can clear the picking flag of a group's group state value in order to establish the group as a decoration in the model that cannot be picked.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |